package com.starhub.domain.ai.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.starhub.common.bean.ResultResp;
import com.starhub.domain.ai.service.IVectorService;

@RestController
@RequestMapping("/api/starhub/vector")
public class VectorController {

    @Autowired
    private IVectorService vectorService;

    @PostMapping("/embed")
    public ResultResp<float[]> embed(@RequestBody String text) {
        return ResultResp.success(vectorService.textToVector(text));
    }
}